﻿using System;
using System.Collections.Generic;
using ZyGames.DZPocker.Model;
using ZyGames.Framework.Cache.Generic;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Context;
using ZyGames.Framework.Game.Contract;
using ZyGames.Framework.Game.Contract.Action;
using ZyGames.Framework.Game.Lang;
using ZyGames.Framework.Game.Service;
using System.Linq;
using ZyGames.DZPocker.Bll.Logic;
using ZyGames.DZPocker.Script;
using System.Text.RegularExpressions;
using ZyGames.DZPocker.Tools;

namespace ZyGames.DZPocker.Script.CsScript.Action
{
	/// <summary>
	/// 30066_广播玩家发送表情
	/// </summary>
	public class Action30066 : BaseAction
	{
		private int tableId;
		private int userId;
		private int posId;
		/// <summary>
		/// 表情Name
		/// </summary>
		private string expName;

		public Action30066(HttpGet actionGetter)
			: base((short)ActionType.DZBrocastSendExpression, actionGetter)
		{
		}
		public override bool GetUrlElement()
		{
			if (httpGet.GetInt("TableId", ref tableId) &&
				httpGet.GetInt("UserId", ref userId) &&
				httpGet.GetInt("PosId", ref posId) &&
				httpGet.GetString("ExpName", ref expName))
			{
				return true;
			}
			return false;
		}

		public override bool TakeAction()
		{
			return true;
		}

		public override void BuildPacket()
		{
			this.PushIntoStack(this.tableId);
			this.PushIntoStack(this.userId);
			this.PushIntoStack(this.posId);
			this.PushIntoStack(this.expName);
		}
	}
}
